package com.ideal.manage.esms.repository.programme;


import com.ideal.manage.esms.bean.project.ArithmeticDeployManage;
import com.ideal.manage.esms.repository.framework.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ArithmeticDeployManageRepository extends BaseRepository<ArithmeticDeployManage, String> {

    @Query("select a from ArithmeticDeployManage a where a.isValid = 1")
    List<ArithmeticDeployManage> findDeployManages();

    @Query("select a from ArithmeticDeployManage a where a.equipmentId.id=?1 and a.isValid=1")
    List<ArithmeticDeployManage> findByEquipmentId(String equipmentId);

    @Query("select a from ArithmeticDeployManage a where a.isValid = 0 and a.equipmentId.id=?1 and a.arithmeticId.id=?2")
    ArithmeticDeployManage findDelDeployManages(String equipmentId,String arithmeticId);

    @Query("select a from ArithmeticDeployManage a where a.isValid = 1 and a.equipmentId.id=?1 and a.arithmeticId.id=?2")
    ArithmeticDeployManage findDeployManages(String equipmentId,String arithmeticId);

    @Query("select a from ArithmeticDeployManage a where a.isValid =1 and a.arithmeticId.id=?1")
    List<ArithmeticDeployManage> findByArithmeticId(String arithmeticId);
}
